package com.guaoran.distributed.message.rabbitmq.springboot.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author : guaoran
 * @Description : <br/>
 *  消费队列
 * @date :2019/1/17 10:52
 */
@Component
@PropertySource("classpath:rabbitmq.properties")
@RabbitListener(queues = "${com.guaoran.secondqueue}", containerFactory="rabbitListenerContainerFactory")
public class SecondConsumer {
    @RabbitHandler
    public void process(String msg){
        System.out.println("Second Queue received msg : " + msg );
    }
}
